package com.neusoft.work.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.work.po.BedInfo;
import com.neusoft.work.po.ResponseBean;
import com.neusoft.work.service.BedInfoService;

@RequestMapping("/BedInfoController")
@RestController
public class BedInfoController {
    @Autowired
    private BedInfoService bedInfoService;

    @PostMapping("/updateStatusByBedNumber")
    public ResponseBean<Integer> updateStatusByBedNumber(String bedNumber, Integer status) {
    	return bedInfoService.updateStatusByBedNumber(bedNumber, status);
    }
    
    @PostMapping("/updateStatusByCustomer")
    public ResponseBean<Integer> updateStatusByCustomer(Integer customerId, Integer status) {
      return bedInfoService.updateStatusByCustomer(customerId, status);
    }

    @PostMapping("/queryVacantBedNumberByRoomNumber")
    public ResponseBean<List<String>> queryVacantBedNumberByRoomNumber(String roomNumber) {
        return bedInfoService.queryVacantBedNumber(roomNumber);
    }

    @RequestMapping("/queryEveryStatusAmount")
    public ResponseBean<Integer> queryEveryStatusAmount(Integer status) {
        return bedInfoService.queryEveryStatusAmount(status);
    }

    @RequestMapping("/queryBedAmountByRoomNumber")
    public ResponseBean<Integer> queryBedAmountByRoomNumber(String roomNumber) {
        return bedInfoService.queryBedAmountByRoomNumber(roomNumber);
    }

    @RequestMapping("/queryBedNumberByRoomNumber")
    public ResponseBean<List<String>> queryBedNumberByRoomNumber(String roomNumber) {
        return bedInfoService.queryBedNumberByRoomNumber(roomNumber);
    }

    @RequestMapping("/queryStatusByBedNumber")
    public ResponseBean<Integer> queryStatusByBedNumber(String bedNumber) {
        return bedInfoService.queryStatusByBedNumber(bedNumber);
    }

    @RequestMapping("/queryBedsByRoomNumber")
    public ResponseBean<List<BedInfo>> queryBedsByRoomNumber(@RequestParam String roomNumber) {
        return bedInfoService.queryBedsByRoomNumber(roomNumber);
    }
}
